package com.zsc.newbuds.mapper;

import com.zsc.newbuds.entity.Recycle;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author D
 */
public interface RecycleMapper {

    /**
     * 获取所有捐赠记录
     */
    @Select("select * from recycle")
    List<Recycle> getRecycleList();

    /**
     * 更新志愿者申请状态
     * @param id
     * @param state
     */
    @Update("update recycle set state = #{state} where recycle_id = #{id}")
    void updateState(Integer id,String state);

    @Select("select * from recycle where recycle_id = #{id}")
    Recycle getRecycleById(@Param("id") int id);
}
